import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 示例分类表 */
export interface Demo02Category {
    id: number; // 编号
    name?: string; // 名字
    parent_id?: number; // 父级编号
    creator?: string; // 创建者
    create_time?: Date; // 创建时间
    updater?: string; // 更新者
    update_time?: Date; // 更新时间
    deleted?: number; // 是否删除
    tenant_id?: number; // 租户编号
  }

// 示例分类表 API
export const Demo02CategoryApi = {

  getDemo02CategoryList: async (params: any) => {
    return await request.get({ url: `/yudao/demo02-category/simple-list`, params })
  },
  // 查询示例分类表文件分页
  getDemo02CategoryPage: async (params: any) => {
    return await request.get({ url: `/yudao/demo02-category/page`, params })
  },

  // 查询示例分类表文件详情
  getDemo02Category: async (id: number) => {
    return await request.get({ url: `/yudao/demo02-category/get?id=` + id })
  },

  // 新增示例分类表文件
  createDemo02Category: async (data: Demo02Category) => {
    return await request.post({ url: `/yudao/demo02-category/create`, data })
  },

  // 修改示例分类表文件
  updateDemo02Category: async (data: Demo02Category) => {
    return await request.put({ url: `/yudao/demo02-category/update`, data })
  },

  // 删除示例分类表文件
  deleteDemo02Category: async (id: number) => {
    return await request.delete({ url: `/yudao/demo02-category/delete?id=` + id })
  },

  /** 批量删除示例分类表文件 */
  deleteDemo02CategoryList: async (ids: number[]) => {
    return await request.delete({ url: `/yudao/demo02-category/delete-list?ids=${ids.join(',')}` })
  },

  // 导出示例分类表文件 Excel
  exportDemo02Category: async (params) => {
    return await request.download({ url: `/yudao/demo02-category/export-excel`, params })
  }
}